unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TParent=class(TObject)
  public
    procedure CallName;virtual;
  end;

  TChildx=class(TParent)
  public
    NameLink:string;
  end;

  TChildA=class(TChildx)
  public
    procedure CallName;override;
  end;

  TChildB=class(TChildx)
  public
    procedure CallName;override;
  end;
  
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

{ TChildB }



{ TChildA }

procedure TChildA.CallName;
begin
  inherited;
  ShowMessage('ChildA:The Name Is'+NameLink);
end;

{ TChildB }

procedure TChildB.CallName;
begin
  //inherited;
  ShowMessage('ChildB:The Name Is'+NameLink);
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  Childx:TChildx;
begin
  Childx:=TChildB.Create;
  Childx.NameLink:='childx';

  TChildA(Childx).CallName;
end;

{ TParent }

procedure TParent.CallName;
begin
  ShowMessage('Parent.Name');
end;

end.
 